package com.controller;

import com.domain.Company;
import com.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/company")
public class CompanyController {
    @Autowired
    private CompanyService companyService;

    @RequestMapping("/findAll/{cid}")
    public ModelAndView Rec(@PathVariable("cid")Integer cid) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("company_rec",companyService.Rec(cid));
        modelAndView.addObject("cid",cid);
        modelAndView.setViewName("company_rec");
        return modelAndView;
    }


}
